// random.cpp.  Maggie Johnson
// Description: Illustrates how to generate a random number in C++

#include <iostream>
#include <time.h>
using namespace std;

int main ()
{
  int seed;
  int random_number;

 //srand (time(NULL));
  do {
    cout << "Enter a number (-1 = quit): ";
    if (!(cin >> seed)){
      cout << "You entered a non-numeric." << endl;
      cin.clear();
      cin.ignore(1000, '\n');
    } else{
      srand(seed);
      random_number = rand() % 100 + 1;
      cout << "Your random number:" << random_number << endl; 
    }
  } while (seed != -1);
  
}
